<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
		function myfn(){
			var reg = /^http/;
			location.href = reg.test(i1.value)?i1.value:"http://"+i1.value;
			
		}
</script>
</head>
<body>
<input type="text" id="i1" placeholder="请输入请求地址">
<input type="button" value="访问" onclick="myfn()">
</body>
</html>